<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition template="templateadmin.xhtml">
        <ui:define name="content">
            <center>
                <b><h1>Management Location</h1></b>
                <h:form>
                    <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                        <tr>
                            <th class="table-header-repeat line-left minwidth-1" width="150px"><a href="">Location ID</a>	</th>
                            <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Location Name</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="320px"><a href="">Description</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Option</a></th>
                        </tr>
                        <ui:repeat value="#{mngLocationsBean.listLocal}" var="local">
                            <tr>
                                <td>#{local.locationID}</td>
                                <td><h:inputText id="txtName" value="#{local.locationName}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                    <br/>
                                    <h:message for="txtName" styleClass="error-inner"></h:message>
                                </td>
                                <td><h:inputTextarea id="txtDes" value="#{local.description}" styleClass="form-textarea2" required="true" requiredMessage="This field is required."></h:inputTextarea>
                                    <br/>
                                    <h:message for="txtDes" styleClass="error-inner"></h:message>
                                </td>
                                <td><h:commandButton action="#{mngLocationsBean.updateLocalAction(local)}" value="Update" styleClass="form-update" onclick="show_alert()"></h:commandButton></td>
                            </tr>
                        </ui:repeat>
                    </table>
                </h:form>
                Page : <ui:repeat value="#{mngLocationsBean.listPage}" var="index">
                    <a href="managementlocations.xhtml?pageID=#{index}">#{index}</a> -
                </ui:repeat>
                <h:form id ="form2">
                    <table border="0" cellpadding="0" cellspacing="0" id="product-table" style="margin: 0 0 0 151px;">
                        <tr>
                            <!--                            <th class="table-header-repeat line-left minwidth-1" width="150px" ><a href="">Package Type ID</a>	</th>-->
                            <th class="table-header-repeat line-left minwidth-1" width="220px"><a href="">Location Name</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="320px"><a href="">Description</a></th>
                            <th class="table-header-repeat line-left minwidth-1" width="100px"><a href="">Option</a></th>
                        </tr>
                        <tr>
                            <td><h:inputText id="newName" value="#{mngLocationsBean.local.locationName}" styleClass="inp-form" required="true" requiredMessage="This field is required."></h:inputText>
                                <br/>
                                <h:message for="newName" styleClass="error-inner"></h:message>
                            </td>
                            <td><h:inputTextarea id="newDes" value="#{mngLocationsBean.local.description}" styleClass="form-textarea2" required="true" requiredMessage="This field is required."></h:inputTextarea>
                                <br/>
                                <h:message for="newDes" styleClass="error-inner"></h:message>
                            </td>
                            <td><h:commandButton action="#{mngLocationsBean.addNewLocalAction}" value="Update" styleClass="form-submit"></h:commandButton></td>
                        </tr>
                    </table>
                </h:form>
            </center>
        </ui:define>
    </ui:composition>
</html>

